<template>
    <div class="storycontent">
        <StoryContent :content="contentList" />
        <!-- <RunStory :roleList="contentList"/> -->
    </div>
    
</template>


<script>
import { debounce } from "lodash-es";
import StoryContent from "../components/StoryContent.vue"
// import RunStory from '../components/RunStory.vue';
export default {
    data(){
        return{
            id:0,
            // author:null,
            contentList:[],
            // disshow:false
        }
    },
  created() {
    this.getData = debounce(this.getData);
  },
  mounted() {
    this.getData();
  },

  components:{
    StoryContent,
    // RunStory
  },

  methods: {
    getData() {
      // this.$nextTick=(()=>{
      //   this.disshow=true
      // })
      this.id = JSON.parse(sessionStorage.contentList).id;
      this.$axios
        .get(`http://new.puncheers.com/api/v1/story/content/list?chapter_id=${this.id}`)
        .then(({ data }) => {
          this.contentList = data.data;
          // console.log(data,this.id);
          // this.author=data.data[0].content
          // console.log(data.data);
        });
    },
  },
};
</script>

<style lang="scss" scoped>
    .storycontent{
        position: fixed;
        top:0;
        width: 100vw;
        height: 100vh;
        background-color:white;
    }
</style>